#include <QCoreApplication>
#include <iostream>
#include <cmath>
using namespace std;

int main(int argc, char *argv[])
{
    QCoreApplication w(argc, argv);
    int a;
    int i=3;
    cout<<"Vvedite a: ";
    cin>>a;
    while(i<a)
    {
        i=i*3;
    }
    if(i!=a)
    cout<<"False";
    else
    cout<<"True";
    return w.exec();
}
